package com.example.oauth2test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: Ben
 * @Date: 2021/12/29 17:59
 */
@RestController
public class HelloController {
    @Autowired
    Oauth2 oauth2;
    @GetMapping("/callback")
    public String hello(String code) {
        System.out.println((oauth2.getData(code)));
        return "index";
    }

}
